package com.music.service.Impl;

import com.music.mapper.CategoryMapper;
import com.music.pojo.Category;
import com.music.pojo.CategoryExample;
import com.music.pojo.UserInfo;
import com.music.pojo.UserInfoExample;
import com.music.service.CateGoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CateGoryServiceImpl implements CateGoryService {

    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> findAll() {
        CategoryExample categoryExample = new CategoryExample();
        return categoryMapper.selectByExample(categoryExample);
    }

    @Override
    public List<Category> findLanguage() {
        CategoryExample categoryExample = new CategoryExample();
        CategoryExample.Criteria criteria = categoryExample.createCriteria();
        criteria.andCnameLike("%语%");
        return categoryMapper.selectByExample(categoryExample);
    }

    @Override
    public List<Category> findStyle() {
        CategoryExample categoryExample = new CategoryExample();
        CategoryExample.Criteria criteria = categoryExample.createCriteria();
        criteria.andCnameNotLike("%语%");
        return categoryMapper.selectByExample(categoryExample);
    }
}
